<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>用户详情</h2>
    </div>
    <div class="tab-wrap">
        <ul class="tab-nav nav">
            <li data-tab="tab1" class="current"><a href="javascript:void(0);">消费记录</a></li>
            <li data-tab="tab3" class=""><a href="javascript:void(0);">用户详情</a></li>
            <li data-tab="tab4" class=""><a href="javascript:void(0);">获赠记录</a></li>
            <!--<li data-tab="tab5" class=""><a href="javascript:void(0);">反馈记录</a></li>-->
        </ul>
        <div class="tab-content">
            <div id="tab1" class="tab-pane in tab1">
                <div class="data-table table-striped">
                    <table class="">
                        <thead>
                        <tr>
                            <th class="">编号</th>
                            <th class="">消费类型</th>
                            <th class="">金额</th>
                            <th class="">消费时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <notempty name="list">
                            <volist name="list" id="vo">
                                <tr>
                                    <td>{$vo.id}</td>
                                    <td>{$vo.type_txt}</td>
                                    <!--    <td>{$vo.pkcode}</td>-->
                                    <td>{$vo.money}</td>
                                    <td>{$vo.createtime}</td>
                                </tr>
                            </volist>
                            <else/>
                            <td colspan="9" class="text-center">Oh! 暂时还没有内容! </td>
                        </notempty>
                        </tbody>
                    </table>
                </div>
                <div class="page">
                    {$_page}
                </div>
            </div>

                <div id="tab3" class="tab-pane tab3">
                    <div class="data-table table-striped">
                    <div class="form-item">
                        <label class="item-label">用户名称</label>
                        <div class="controls">
                            <input type="text" class="text input-large" name="nickname" value="{$userInfo.nickname}" disabled>
                        </div>
                    </div>

                    <div class="form-item">
                        <label class="item-label">手机</label>
                        <div class="controls">
                            <input type="text" class="text input-large" name="nickname" value="{$userInfo.username}" readOnly="true">
                        </div>
                    </div>
                    <div class="form-item cf">
                        <label class="item-label">头像</label>
                        <div class="controls">
                            <input type="hidden" name="avatar_id" id="cover_id_thumb" value="{$info.avatar}"/>
                            <div class="upload-img-box">
                                <notempty name="userInfo.avatar_url">
                                    <div class="upload-pre-item"><img src="{$userInfo.avatar_url}"/></div>
                                </notempty>
                            </div>
                        </div>
                    </div>

                    <div class="form-item">
                        <label class="item-label">元宝</label>
                        <div class="controls">
                            <input type="text" class="text input-large" name="nickname" value="{$userInfo.coin}" readOnly="true">
                        </div>
                    </div>

                    <div class="form-item">
                        <label class="item-label">Go币</label>
                        <div class="controls">
                            <input type="text" class="text input-large" name="nickname" value="{$userInfo.amount}" readOnly="true">
                        </div>
                    </div>

                    <div class="form-item">
                        <label class="item-label">注册时间</label>
                        <div class="controls">
                            <input type="text" class="text input-large" name="nickname" value="{$userInfo.reg_time|time_format}" readOnly="true">
                        </div>
                    </div>
                    </div>
                </div>




            <div id="tab4" class="tab-pane  tab4">
                <div class="data-table table-striped">
                    <table class="">
                        <thead>
                        <tr>
                            <th class="">编号</th>
                            <th class="">赠送记录</th>
                            <th class="">赠送时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <notempty name="coin_list">
                            <volist name="coin_list" id="vo">
                                <tr>
                                    <td>{$vo.id}</td>
                                    <td>{$vo.msg}</td>
                                    <td>{$vo.uptime}</td>
                                </tr>
                            </volist>
                            <else/>
                            <td colspan="9" class="text-center">Oh! 暂时还没有内容! </td>
                        </notempty>
                        </tbody>
                    </table>
                </div>

            </div>



    </div>

            <img id="displayBox" src="__PUBLIC__/Admin/images/wait.gif" alt="" style="display: none">
        <a class="btn btn-return" href="{:U('User/index')}">返 回</a>

</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('shop/manage')}');
        showTab();

        $(document).ajaxStart(function(){

            $.blockUI({

                message:$('#displayBox'),
                css:{

                    width:'400px',
                    top:'60%',
                    border:'none',
                    backgroundColor:'#F6F6F6'
                },
                overlayCSS:{backgroundColor:'#fff'}
            })

        }).ajaxStop($.unblockUI);

        $('.editPass').click(function(){

        var passFrom         = document.getElementById('passFrom');

        var passFromData  = new  FormData(passFrom);



        $.ajax({
            url: "{:U('admin/user/editPassword')}",
            type: "POST",
            data: passFromData,
            processData: false,  // 告诉jQuery不要去处理发送的数据
            contentType: false,  // 告诉jQuery不要去设置Content-Type请求头
            success: function(msg){
                alert( msg['msg'] );

                if (msg['code'] ===1 ){

                    window.location.href = '{:U("admin/user/index")}'
                }
            },
            error:function(){

                alert('网络错误，稍后再试');

            }
        });

            return false;
    })
    </script>
</block>